home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ADA Programming Guide
/
ADA Programming Guide.iso
/
ada_a9x
/
delay.ada
< prev
next >
Wrap
Text File
|
1996-01-30
|
617b
|
30 lines
WITH Text_IO; USE Text_IO;
WITH Calendar; USE Calendar;
PROCEDURE Testa_Delay IS
Interval : Duration := 0.05;
Next_Time : Time;
Work_Time : Time;
TASK Will_Be_Aborted IS
ENTRY Start;
END Will_Be_Aborted;
TASK BODY Will_Be_Aborted IS
BEGIN
ACCEPT Start;
LOOP
Put('a');
END LOOP;
END Will_Be_Aborted;
BEGIN
Next_Time := Clock + Interval;
Work_Time := Clock + 0.2;
Will_Be_Aborted.Start;
WHILE Clock <= Work_Time LOOP
DELAY UNTIL Next_Time;
New_Line;
Put('.');
Next_Time := Next_Time + Interval;
END LOOP;
ABORT Will_Be_Aborted;
New_Line;
END Testa_Delay;